package com.intermancer.trader.mutation;

import com.intermancer.predictor.gene.Chromosome;
import com.intermancer.predictor.gene.window.LocalExtremeWG;
import com.intermancer.predictor.mutation.ChromosomeRegistrar;

public class TraderChromosomeFactory extends ChromosomeRegistrar {

	/**
	 * A ProjectedLineChromosome uses two channels (rangeIndex and domainIndex)
	 * to define points in a two dimensional space. It then uses either the two
	 * highest local maximum values or two lowest local minimum values to define
	 * a line. The chromosome finally adds a channel to the quantum which
	 * reflects the distance between the last data point and the projected line.
	 * 
	 * The final data point is not used in determining projections.
	 * 
	 * @param maximumOriented
	 *            If true, the chromosome will base the projected line on the
	 *            two greatest local maxima within the window. If false, it will
	 *            use the two lowest local minima.
	 * @param windowSize
	 *            The number of quanta that are considered in the projection.
	 * @param rangeIndex
	 *            The index of the channel to use for the y-axis.
	 * @param domainIndex
	 *            The index of the channel to use for the x-axis.
	 * @param sensitivity
	 *            Used for determining either local minima or local maxima.
	 * @return The distance, measured along the y-axis, between the last derived
	 *         data point and the projected line. A negative number means that
	 *         the latest data point is below the projected line.
	 */
	public Chromosome getProjectedLineChromosome(boolean maximumOriented,
			int windowSize, int rangeIndex, int domainIndex, int sensitivity) {
		LocalExtremeWG extreme1 = new LocalExtremeWG(windowSize, sensitivity);
		extreme1.setExtremaOffset(0);
		extreme1.setMaximum(maximumOriented);
		extreme1.setWindowSize(windowSize);
		LocalExtremeWG extreme2 = new LocalExtremeWG(windowSize, sensitivity);
		extreme2.setExtremaOffset(1);
		extreme2.setMaximum(maximumOriented);
		extreme2.setWindowSize(windowSize);
		return null;
	}

}
